package org.wisdom.ac.service;

import org.springframework.stereotype.Service;
import org.wisdom.ac.apis.AuthController;
import org.wisdom.service.ICheckPreAuthorizeService;

import lombok.AllArgsConstructor;

/**
 * 验证是否有权限
 *
 * @author 张智研
 * @date 2023/05/16 14:52
 **/
@Service
@AllArgsConstructor
public class CheckPreAuthorizeServiceImpl implements ICheckPreAuthorizeService {

    private AuthController authController;

    @Override
    public boolean hasPermission(String permission) {
        return authController.hasPermission(permission).getCode() == 1;
    }
}
